<ui:composition
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:q="http://huliqing.name/qfaces"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:c="http://java.sun.com/jsp/jstl/core"
    template="/WEB-INF/template/layout_system.xhtml">

    <ui:define name="subTabName">
        <c:set var="subTabName" value="settings" />
    </ui:define>

    <ui:define name="menuTitle">
        <img src="/_res/image/star.png" height="40" class="alignM" alt=""/>
        系统设置
    </ui:define>

    <ui:define name="menuContent">
        <q:saveState value="#{settingsWe.configs}" />
        <h:form>
            <h:dataTable value="#{settingsWe.configs}"
                         var="config"
                         rowClasses="row2,row1"
                         cellpadding="3"
                         cellspacing="3"
                         width="100%"
                         headerClass="header">
                <h:column>
                    <f:facet name="header">
                        <h:outputText value="系统参数" />
                    </f:facet>
                    <h:outputText value="#{config.name}" />
                </h:column>

                <h:column>
                    <f:facet name="header">
                        <h:outputText value="定义值" />
                    </f:facet>
                    <h:inputText value="#{config.value}" style="width:200px;"/>
                </h:column>

                <h:column>
                    <f:facet name="header">
                        <h:outputText value="说明" />
                    </f:facet>
                    <h:outputText value="#{text[config.name]}"  style="color:gray;line-height: 1.2;"/>
                </h:column>
            </h:dataTable>
            <h:panelGroup layout="block" styleClass="marginT">
                <h:commandButton value="Update Configs" action="#{settingsWe.updateAll}" styleClass="button"/>
                <h:commandButton value="Reset All"
                                 action="#{settingsWe.resetAll}"
                                 styleClass="button marginL"
                                 onclick="return confirm('#{text['p.settings.resetConfigs']}');" />
            </h:panelGroup>
        </h:form>
    </ui:define>
</ui:composition>